module Vec
    using LinearAlgebra
    using StaticArrays

    const Vec2{T} = SVector{2, T}
    function Vec2(x::T, y::T) where {T}
        Vec2{T}(x, y)
    end

    X(v::Vec2) = v[1]
    Y(v::Vec2) = v[2]

    Dot(v1::Vec2, v2::Vec2) = dot(v1, v2)
    Normalize(v::Vec2) = normalize(v)
    Length(v::Vec2) = norm(v)
    Proj(v::Vec2, p::Vec2) = dot(v, normalize(p))
    Output(v::Vec2) = println(X(v::Vec2), "\t", Y(v::Vec2))
end
# v1 = Vec.Vec2(1, 2)
# Vec.Output(v1)
# v2 = Vec.Init(2, 1)
# v3 = Vec.Init(0, 0)
# v4 = v1 + v2
# println(v4)
# a = Vec.Dot(v1, v2)
# b = Vec.Normalize(v1)
# c = Vec.Length(b)
# d = Vec.Length(v3)
# n = Vec.Proj(v1, v2)
# x = Vec.X(v1)
# y = Vec.Y(v1)

# println(x, "\t", y)
